package wangjg.android.uitest;

import wangjg.android.R;
import wangjg.android.R.anim;
import wangjg.android.R.id;
import wangjg.android.R.layout;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.GridLayout;

public class GridLayoutActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.grid_layout_test);
        GridLayout gl = (GridLayout)this.findViewById(R.id.grid1);
        Button b = new Button(this);
        b.setText("new1");
        b.setWidth(50);
        gl.addView(b);
        
        b = new Button(this);
        b.setText("new2");
        b.setWidth(50);
        b.setVisibility(View.INVISIBLE);
        gl.addView(b);
        
        b = new Button(this);
        b.setText("new3");
        b.setWidth(50);
        gl.addView(b);
        
        Animation animation= AnimationUtils.loadAnimation(this,R.anim.myanim);
        b.startAnimation(animation);
     }
    
}